package cn.epsilon3.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.epsilon3.annotation.E3Log;
import cn.epsilon3.annotation.E3Service;
import cn.epsilon3.common.Result;
import cn.epsilon3.constant.ResultEnum;
import cn.epsilon3.domain.e3.dto.add.E3UrlAdd;
import cn.epsilon3.service.E3UrlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 接口路径(e3_url)表控制层
 *
 * @author epsilon3
 * @since 2023-12-15 17:01:36
 */
@Api(
        tags = {"E3-接口路径管理器v1.0.2.pre-alpha"}
)
@E3Service(
        path = "/url"
)
public class E3UrlController {
    /**
     * 服务对象
     */
    @Resource
    private E3UrlService urlService;



    @SaCheckPermission(value = "system:url:add")
    @ApiOperation("新增功能路径")
    @PostMapping("add")
    @E3Log
    public Result<String> add(@Valid E3UrlAdd urlAdd) {
        urlService.add(urlAdd);
        return new Result<>(ResultEnum.SUCCESS,"新增功能路径成功");
    }

}

